package com.kotlin.lib

import com.kotlin.lib.BuildTypes.BuildByChannel
import com.kotlin.lib.BuildTypes.BuildByServer

sealed class BuildTypes {
    data class BuildByChannel(val channelName: String) : BuildTypes()

    data class BuildByServer(val server: String) : BuildTypes()

}

fun main() {
    val buildByChannel = BuildByChannel("google")

    val buildByServer = BuildByServer("stg")

    println(buildByChannel)
    println(buildByServer)

    printType(buildByServer)
}

fun printType(types: BuildTypes) {
    when (types) {
        is BuildByChannel -> {
            println("BuildByChannel")
        }
        is BuildByServer -> {
            println("BuildByServer")
        }
   
    }
}